#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int waysToSplitArray(vector<int>& nums) {
        using LL = long long;
        LL sum = 0;
        for (auto& e : nums) sum += e;
        LL prev = 0, res = 0, n = nums.size();
        for (int i = 0; i < n - 1; i++)
        {
            prev += nums[i];
            sum -= nums[i];
            if (prev >= sum) ++res;
        }
        return res;
    }
};